<div>
    <div style="margin-bottom:15px;overflow: hidden;">
        <div style="float: right">
            <nz-input-group style="width:220px;" nzSearch [nzAddOnAfter]="suffixButton">
                <input type="text" nz-input placeholder="请输入取药码" />
            </nz-input-group>
            <ng-template #suffixButton>
                <button nz-button nzType="primary" nzSearch>查找</button>
            </ng-template>
        </div>
        <button nz-button nzType="primary" style="margin-right: 8px;" (click)="approve()">审核入库</button>
        <button nz-button nzType="default" (click)="reject()">退回</button>
    </div>
    <nz-table class="medical-table" nzSize="small" #basicTable [nzFrontPagination]="false" [nzLoading]="isLoading" [nzData]="departmentList" [nzTotal]="page.total" [nzPageIndex]="page.pageNo" [nzPageSize]="page.pageSize" (nzPageIndexChange)="changeCurrentPage($event)">
        <thead>
            <tr>
                <th nzWidth="50px" nzLeft="0px"></th>
                <th>下单时间</th>
                <th>患者姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>就诊卡号</th>
                <th>处方号</th>
                <th>备注</th>
                <th nzRight="0px">审核状态</th>
            </tr>
        </thead>
        <tbody>
            <tr *ngFor="let data of basicTable.data" [ngClass]="{'selectedRow':selectedRowData.id === data.id}" (click)="selectedRow(data)">
                <td nzLeft="0px" style="background: #fff;"><span class="checkbox" [ngClass]="{active:selectedRowData.id === data.id}"><i nz-icon nzType="check" nzTheme="outline"></i></span></td>
                <td>{{ data.createTime }}</td>
                <td>{{ data.patientName }}</td>
                <td>{{ data.patientGender === "male" ? "男" : data.patientGender === "female" ? "女" : "未知" }}</td>
                <td>{{ data.patientAge }}</td>
                <td>{{ data.cardNo }}</td>
                <td>{{ data.prescId }}</td>
                <td>{{ data.memo }}</td>
                <td nzRight="0px">{{ statusType[data.status] || '--' }}</td>
            </tr>
        </tbody>
    </nz-table>
    <div class="pannel" *ngIf="selectedRowData.id">
        <div class="pannel-head">诊断信息</div>
        <div class="pannel-body">
            <div nz-row>
                <div nz-col nzSpan="12"><label>诊断名称：</label>{{ selectedRowData.diagnosisName }}</div>
            </div>
        </div>
    </div>
    <div class="pannel" *ngIf="selectedRowData.id">
        <div class="pannel-head">处方信息</div>
        <div class="pannel-body">
            <nz-table #borderedTable nzBordered [nzShowPagination]="false" [nzData]="medicineList">
                <thead>
                    <tr>
                        <th>药品名称</th>
                        <th>药品规格</th>
                        <th>生产厂商</th>
                        <th>数量</th>
                        <th>剂量</th>
                        <th>频次</th>
                        <th>使用方式</th>
                    </tr>
                </thead>
                <tbody>
                    <tr *ngFor="let data of medicineList">
                        <td>{{ data.name }}</td>
                        <td>{{ data.spec }}</td>
                        <td>{{ data.idm }}</td>
                        <td>{{ data.quantity }}</td>
                        <td>{{ data.dosage }}</td>
                        <td>{{ data.frequency }}</td>
                        <td>{{ data.instruction }}</td>
                    </tr>
                </tbody>
            </nz-table>
        </div>
    </div>
    <nz-drawer [nzClosable]="true" [nzVisible]="isVisible" [nzHeight]="auto" [nzMaskClosable]="true" [nzPlacement]="'bottom'" nzTitle="审核操作" (nzOnClose)="isVisible = false">
        <div style="margin-top:30px;">
            <div style="text-align: center;width:500px;margin:0 auto;">
                <nz-form-item>
                    <nz-form-label [nzSm]="6" [nzXs]="24">驳回原因</nz-form-label>
                    <nz-form-control [nzSm]="14" [nzXs]="24">
                        <textarea rows="4" nz-input placeholder="驳回时请填写驳回原因..." [(ngModel)]="memo"></textarea>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item>
                    <nz-form-control nzOffset="6" [nzSm]="14" [nzXs]="24">
                        <button nz-button nzType="default" style="margin:20px;" (click)="rejecting()">退回</button>
                    </nz-form-control>
                </nz-form-item>
            </div>
        </div>
    </nz-drawer>
</div>
